package com.grass.p019lv.adapter;

import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.androidsa.bttsddka.R;
import com.androidx.p013lv.base.bean.SearchBean;
import java.util.ArrayList;
import java.util.List;

/* renamed from: com.grass.lv.adapter.AdapterSearchRecommend */
public class AdapterSearchRecommend extends BaseAdapter {
    Context mContext;
    List<SearchBean.ListBean> mList = new ArrayList();

    public long getItemId(int i) {
        return (long) i;
    }

    public AdapterSearchRecommend(Context context) {
        this.mContext = context;
    }

    public void setList(List<SearchBean.ListBean> list) {
        this.mList = list;
        notifyDataSetChanged();
    }

    public int getCount() {
        return this.mList.size();
    }

    public SearchBean.ListBean getItem(int i) {
        return this.mList.get(i);
    }

    public View getView(int i, View view, ViewGroup viewGroup) {
        ViewHolder viewHolder;
        if (view == null) {
            view = LayoutInflater.from(this.mContext).inflate(R.layout.item_search_recommend, viewGroup, false);
            viewHolder = new ViewHolder();
            viewHolder.tv_title = (TextView) view.findViewById(R.id.tv_title);
            viewHolder.tv_no = (TextView) view.findViewById(R.id.tv_no);
            viewHolder.iv_hot = (ImageView) view.findViewById(R.id.iv_hot);
            view.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) view.getTag();
        }
        if (i < 4) {
            viewHolder.tv_no.setTextColor(Color.parseColor("#D43B33"));
            viewHolder.tv_title.setTypeface(Typeface.DEFAULT_BOLD);
            viewHolder.iv_hot.setVisibility(0);
        } else {
            viewHolder.tv_no.setTextColor(Color.parseColor("#5B5B5B"));
            viewHolder.tv_title.setTypeface(Typeface.DEFAULT);
            viewHolder.iv_hot.setVisibility(8);
        }
        TextView textView = viewHolder.tv_no;
        textView.setText((i + 1) + "");
        viewHolder.tv_title.setText(this.mList.get(i).getHotTitle());
        return view;
    }

    /* renamed from: com.grass.lv.adapter.AdapterSearchRecommend$ViewHolder */
    class ViewHolder {
        ImageView iv_hot;
        TextView tv_no;
        TextView tv_title;

        ViewHolder() {
        }
    }
}
